using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using Northwoods.Go.Xml;

namespace Rules.Diagram
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class ConditionalInfo : Info
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="node"></param>
        public ConditionalInfo(RuleNode node) : base(node) { }

        public override String ToString()
        {
            return "Input1: " + this.Input1 + Environment.NewLine + "Input2: " + this.Input2;
        }

        /// <summary>
        /// 
        /// </summary>
        [Category("Conditional"), Description("an input for the conditional test")]
        public String Input1
        {
            get { return myInput1; }
            set { myInput1 = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        [Category("Conditional"), Description("an input for the conditional test")]
        public String Input2
        {
            get { return myInput2; }
            set { myInput2 = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        public override void GenerateAttributes(GoXmlTransformer x)
        {
            x.WriteAttrVal("Input1", this.Input1);
            x.WriteAttrVal("Input2", this.Input2);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        public override void ConsumeAttributes(GoXmlTransformer x)
        {
            this.Input1 = x.StringAttr("Input1", "");
            this.Input2 = x.StringAttr("Input2", "");
        }

        private String myInput1 = "";
        private String myInput2 = "";
    }
}
